package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.AutoSoftInfo;
import com.appwoo.txtws.component.Global;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.component.RqSP;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class RecomSoftServer
{
  private String bid;
  private Context context;
  private String number;
  private RqSP rqsp = new RqSP();

  public RecomSoftServer(Context paramContext)
  {
    this.context = paramContext;
    if (this.rqsp.getExitVal(paramContext) == 1)
    {
      this.number = this.rqsp.getLgDevAccount(paramContext);
      this.bid = this.rqsp.getLgDevId(paramContext);
      return;
    }
    this.number = this.rqsp.getChildId(paramContext);
    this.bid = Global.getIMEI(paramContext);
  }

  public ArrayList<AutoSoftInfo> installSoftWare(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    ArrayList localArrayList1 = new ArrayList();
    String str1 = "无数据";
    String str2 = "<MSG><HEAD><SNDR>" + this.number + "</SNDR> " + "<TYPE>RQSoftLib</TYPE></HEAD>" + "<BODY>" + "<BID>" + this.bid + "</BID>" + "<PageIndex>" + paramInt3 + "</PageIndex>" + "<PageSize>" + paramInt4 + "</PageSize>";
    if (paramInt1 == 1)
      str2 = str2 + "<IsRecd>" + paramInt1 + "</IsRecd>";
    if (paramInt2 == 1)
      str2 = str2 + "<IsInstalled>" + paramInt2 + "</IsInstalled>";
    String str3 = str2 + "</BODY></MSG>";
    MsgService localMsgService = new MsgService();
    try
    {
      Logger.v("io", "msg+=" + str3);
      str1 = localMsgService.sendMessage(this.number, str3, this.context);
      ArrayList localArrayList2 = pullXmlInstall(this.context, str1);
      return localArrayList2;
    }
    catch (IOException localIOException)
    {
      Logger.v("info", str1);
      Logger.v("io", "这里出错了2");
      return localArrayList1;
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      localXmlPullParserException.printStackTrace();
      return localArrayList1;
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.printStackTrace();
      return localArrayList1;
    }
    catch (TimeOutException localTimeOutException)
    {
    }
    return localArrayList1;
  }

  public List<AutoSoftInfo> installSoftWare(int paramInt1, String paramString1, String paramString2, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
  {
    ArrayList localArrayList = new ArrayList();
    String str1 = "<MSG><HEAD><SNDR>" + this.number + "</SNDR> " + "<TYPE>RQSoftLib</TYPE></HEAD>" + "<BODY>" + "<BID>" + this.bid + "</BID>" + "<PageIndex>" + paramInt4 + "</PageIndex>" + "<PageSize>" + paramInt5 + "</PageSize>";
    if (paramInt1 == 1)
      str1 = str1 + "<IsHot>" + paramInt1 + "</IsHot>";
    if (paramString1.length() > 0)
      str1 = str1 + "<SoftType>" + paramString1 + "</SoftType>";
    if (paramString2.length() > 0)
      str1 = str1 + "<SoftName>" + paramString2 + "</SoftName>";
    if (paramInt2 == 1)
      str1 = str1 + "<IsPrecd>" + paramInt2 + "</IsPrecd>";
    if (paramInt3 == 1)
      str1 = str1 + "<IsInstalled>" + paramInt3 + "</IsInstalled>";
    String str2 = str1 + "</BODY></MSG>";
    MsgService localMsgService = new MsgService();
    try
    {
      Logger.v("zhy", "msg+=" + str2);
      String str3 = localMsgService.sendMessage(this.number, str2, this.context);
      localArrayList = pullXmlInstall(this.context, str3);
      Logger.v("info", str3);
      return localArrayList;
    }
    catch (IOException localIOException)
    {
      Logger.v("io", "这里出错了2");
      return localArrayList;
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      localXmlPullParserException.printStackTrace();
      return localArrayList;
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.printStackTrace();
      return localArrayList;
    }
    catch (TimeOutException localTimeOutException)
    {
    }
    return localArrayList;
  }

  public ArrayList<AutoSoftInfo> pullXmlInstall(Context paramContext, String paramString)
    throws IOException, XmlPullParserException
  {
    Object localObject1 = null;
    AutoSoftInfo localAutoSoftInfo = null;
    SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(paramString);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TotalRecord"))
      {
        ((XmlPullParser)localObject2).nextText();
        ((XmlPullParser)localObject2).nextTag();
      }
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("list"))
        localAutoSoftInfo = new AutoSoftInfo();
      if (localAutoSoftInfo != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("KeyID"))
        {
          localAutoSoftInfo.setKeyID(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("ProcName"))
        {
          localAutoSoftInfo.setAspkg(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SoftName"))
        {
          localAutoSoftInfo.setAsname(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SoftPath"))
        {
          localAutoSoftInfo.setAddownloadurl(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("IconPath"))
        {
          localAutoSoftInfo.setAdicon(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SoftSize"))
        {
          localAutoSoftInfo.setSoftSize(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SoftTitle"))
        {
          localAutoSoftInfo.setSoftTitle(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("IsRecd"))
        {
          localAutoSoftInfo.setIsRecd(Integer.valueOf(((XmlPullParser)localObject2).nextText()).intValue());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("IsPrecd"))
        {
          localAutoSoftInfo.setIsPrecd(Integer.valueOf(((XmlPullParser)localObject2).nextText()).intValue());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SoftType"))
        {
          localAutoSoftInfo.setSoftType(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SoftSize"))
        {
          localAutoSoftInfo.setSoftSize(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Author"))
        {
          localAutoSoftInfo.setAuthor(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("HotMark"))
        {
          String str3 = ((XmlPullParser)localObject2).nextText();
          try
          {
            if ((str3.length() <= 0) || ("0".equals(str3)))
              break label622;
            localAutoSoftInfo.setHotMark(str3);
          }
          catch (Exception localException)
          {
            localAutoSoftInfo.setHotMark("3");
            localException.printStackTrace();
          }
          continue;
          label622: localAutoSoftInfo.setHotMark("3");
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("UpdateTime"))
        {
          String str2 = ((XmlPullParser)localObject2).nextText();
          if (str2.length() > 0)
            try
            {
              localAutoSoftInfo.setUpdateTime(localSimpleDateFormat.format(localSimpleDateFormat.parse(str2)));
            }
            catch (ParseException localParseException)
            {
              localAutoSoftInfo.setUpdateTime("");
            }
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TypeName"))
        {
          localAutoSoftInfo.setTypeName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Version"))
        {
          String str1 = ((XmlPullParser)localObject2).nextText();
          Logger.i("zhy", str1);
          localAutoSoftInfo.setVersion(str1);
          continue;
          if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("list"))
          {
            ((ArrayList)localObject1).add(localAutoSoftInfo);
            localAutoSoftInfo = null;
          }
        }
    }
  }

  // ERROR //
  public com.appwoo.txtws.bean.StateBean updateRecd(java.util.Map<String, Integer> paramMap, String paramString1, String paramString2)
  {
    // Byte code:
    //   0: new 330	com/appwoo/txtws/bean/StateBean
    //   3: dup
    //   4: invokespecial 331	com/appwoo/txtws/bean/StateBean:<init>	()V
    //   7: astore 4
    //   9: new 63	java/lang/StringBuilder
    //   12: dup
    //   13: ldc 65
    //   15: invokespecial 68	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   18: aload_2
    //   19: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   22: ldc 74
    //   24: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   27: ldc_w 333
    //   30: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   33: ldc 78
    //   35: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   38: ldc 80
    //   40: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   43: aload_3
    //   44: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   47: ldc 82
    //   49: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   52: invokevirtual 97	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   55: astore 5
    //   57: aload_1
    //   58: invokeinterface 339 1 0
    //   63: invokeinterface 345 1 0
    //   68: astore 6
    //   70: aload 6
    //   72: invokeinterface 351 1 0
    //   77: ifne +119 -> 196
    //   80: new 63	java/lang/StringBuilder
    //   83: dup
    //   84: aload 5
    //   86: invokestatic 103	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   89: invokespecial 68	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   92: ldc 113
    //   94: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   97: invokevirtual 97	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   100: astore 8
    //   102: new 115	com/appwoo/txtws/service/MsgService
    //   105: dup
    //   106: invokespecial 116	com/appwoo/txtws/service/MsgService:<init>	()V
    //   109: astore 9
    //   111: ldc 118
    //   113: new 63	java/lang/StringBuilder
    //   116: dup
    //   117: ldc 120
    //   119: invokespecial 68	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   122: aload 8
    //   124: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   127: invokevirtual 97	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   130: invokestatic 126	com/appwoo/txtws/component/Logger:v	(Ljava/lang/String;Ljava/lang/String;)V
    //   133: aload 9
    //   135: aload_0
    //   136: getfield 33	com/appwoo/txtws/service/RecomSoftServer:number	Ljava/lang/String;
    //   139: aload 8
    //   141: aload_0
    //   142: getfield 23	com/appwoo/txtws/service/RecomSoftServer:context	Landroid/content/Context;
    //   145: invokevirtual 130	com/appwoo/txtws/service/MsgService:sendMessage	(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String;
    //   148: astore 14
    //   150: invokestatic 182	android/util/Xml:newPullParser	()Lorg/xmlpull/v1/XmlPullParser;
    //   153: astore 15
    //   155: aload 15
    //   157: astore 16
    //   159: aload 14
    //   161: invokestatic 188	com/appwoo/android/util/PullIO:getPullByString	(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;
    //   164: astore 24
    //   166: aload 24
    //   168: astore 16
    //   170: aload 16
    //   172: invokeinterface 193 1 0
    //   177: istore 18
    //   179: iload 18
    //   181: istore 19
    //   183: aload 4
    //   185: astore 20
    //   187: iload 19
    //   189: iconst_1
    //   190: if_icmpne +96 -> 286
    //   193: aload 20
    //   195: areturn
    //   196: aload 6
    //   198: invokeinterface 354 1 0
    //   203: astore 7
    //   205: new 63	java/lang/StringBuilder
    //   208: dup
    //   209: aload 5
    //   211: invokestatic 103	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   214: invokespecial 68	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   217: ldc_w 356
    //   220: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   223: aload 7
    //   225: invokevirtual 359	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   228: ldc_w 361
    //   231: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   234: ldc 105
    //   236: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   239: aload_1
    //   240: aload 7
    //   242: invokeinterface 365 2 0
    //   247: invokevirtual 359	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   250: ldc_w 367
    //   253: invokevirtual 72	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   256: invokevirtual 97	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   259: astore 5
    //   261: goto -191 -> 70
    //   264: astore 17
    //   266: aload 17
    //   268: invokevirtual 194	java/lang/NullPointerException:printStackTrace	()V
    //   271: goto -101 -> 170
    //   274: astore 13
    //   276: ldc 118
    //   278: ldc 138
    //   280: invokestatic 126	com/appwoo/txtws/component/Logger:v	(Ljava/lang/String;Ljava/lang/String;)V
    //   283: aload 4
    //   285: areturn
    //   286: iload 19
    //   288: tableswitch	default:+28 -> 316, 0:+52->340, 1:+28->316, 2:+64->352
    //   317: ldc2_w 14852
    //   320: aload 16
    //   322: invokeinterface 197 1 0
    //   327: istore 23
    //   329: iload 23
    //   331: istore 19
    //   333: aload 4
    //   335: astore 20
    //   337: goto -150 -> 187
    //   340: new 330	com/appwoo/txtws/bean/StateBean
    //   343: dup
    //   344: invokespecial 331	com/appwoo/txtws/bean/StateBean:<init>	()V
    //   347: astore 4
    //   349: goto -29 -> 320
    //   352: aload 16
    //   354: invokeinterface 200 1 0
    //   359: ldc_w 369
    //   362: invokevirtual 206	java/lang/String:equalsIgnoreCase	(Ljava/lang/String;)Z
    //   365: ifeq +22 -> 387
    //   368: aload 20
    //   370: aload 16
    //   372: invokeinterface 209 1 0
    //   377: invokevirtual 372	com/appwoo/txtws/bean/StateBean:setCode	(Ljava/lang/String;)V
    //   380: aload 20
    //   382: astore 4
    //   384: goto -64 -> 320
    //   387: aload 16
    //   389: invokeinterface 200 1 0
    //   394: ldc_w 374
    //   397: invokevirtual 206	java/lang/String:equalsIgnoreCase	(Ljava/lang/String;)Z
    //   400: ifeq -84 -> 316
    //   403: aload 20
    //   405: aload 16
    //   407: invokeinterface 209 1 0
    //   412: invokevirtual 377	com/appwoo/txtws/bean/StateBean:setDesc	(Ljava/lang/String;)V
    //   415: goto -99 -> 316
    //   418: astore 22
    //   420: aload 20
    //   422: astore 4
    //   424: goto -148 -> 276
    //   427: astore 12
    //   429: aload 12
    //   431: invokevirtual 141	org/xmlpull/v1/XmlPullParserException:printStackTrace	()V
    //   434: aload 4
    //   436: areturn
    //   437: astore 11
    //   439: aload 11
    //   441: invokevirtual 142	com/appwoo/android/exception/NotFoundNetWorkException:printStackTrace	()V
    //   444: aload 4
    //   446: areturn
    //   447: astore 11
    //   449: aload 20
    //   451: astore 4
    //   453: goto -14 -> 439
    //   456: astore 10
    //   458: aload 4
    //   460: areturn
    //   461: astore 21
    //   463: aload 20
    //   465: areturn
    //   466: astore 12
    //   468: aload 20
    //   470: astore 4
    //   472: goto -43 -> 429
    //
    // Exception table:
    //   from	to	target	type
    //   159	166	264	java/lang/NullPointerException
    //   133	155	274	java/io/IOException
    //   159	166	274	java/io/IOException
    //   170	179	274	java/io/IOException
    //   266	271	274	java/io/IOException
    //   320	329	274	java/io/IOException
    //   340	349	418	java/io/IOException
    //   352	380	418	java/io/IOException
    //   387	415	418	java/io/IOException
    //   133	155	427	org/xmlpull/v1/XmlPullParserException
    //   159	166	427	org/xmlpull/v1/XmlPullParserException
    //   170	179	427	org/xmlpull/v1/XmlPullParserException
    //   266	271	427	org/xmlpull/v1/XmlPullParserException
    //   320	329	427	org/xmlpull/v1/XmlPullParserException
    //   133	155	437	com/appwoo/android/exception/NotFoundNetWorkException
    //   159	166	437	com/appwoo/android/exception/NotFoundNetWorkException
    //   170	179	437	com/appwoo/android/exception/NotFoundNetWorkException
    //   266	271	437	com/appwoo/android/exception/NotFoundNetWorkException
    //   320	329	437	com/appwoo/android/exception/NotFoundNetWorkException
    //   340	349	447	com/appwoo/android/exception/NotFoundNetWorkException
    //   352	380	447	com/appwoo/android/exception/NotFoundNetWorkException
    //   387	415	447	com/appwoo/android/exception/NotFoundNetWorkException
    //   133	155	456	com/appwoo/android/exception/TimeOutException
    //   159	166	456	com/appwoo/android/exception/TimeOutException
    //   170	179	456	com/appwoo/android/exception/TimeOutException
    //   266	271	456	com/appwoo/android/exception/TimeOutException
    //   320	329	456	com/appwoo/android/exception/TimeOutException
    //   340	349	461	com/appwoo/android/exception/TimeOutException
    //   352	380	461	com/appwoo/android/exception/TimeOutException
    //   387	415	461	com/appwoo/android/exception/TimeOutException
    //   340	349	466	org/xmlpull/v1/XmlPullParserException
    //   352	380	466	org/xmlpull/v1/XmlPullParserException
    //   387	415	466	org/xmlpull/v1/XmlPullParserException
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.RecomSoftServer
 * JD-Core Version:    0.6.2
 */